import {
  fields
} from './fields.js'
import {
  data
} from './data.js'
export const grid = {
  fields: [{
    label: '选择',
    type: 'selection'
  }, {
    type: 'index',
    label: '#'
  },
  ...fields,
  {
    label: '操作',
    type: 'operation',
    options: [{
      label: 'edit',
      name: 'edit',
      click: (e, {
        row
      }) => {
        console.log('edit', e, {
          row
        })
        // emit(form, "add", model)

      }
    }, {
      label: 'del',
      name: 'del',
      click: (e, {
        row,
        rowIndex,
        table,
        emit
      }) => {
        console.log('del', e, row, table)
        emit(table, "del", {
          row,
          rowIndex
        })

      }
    }]
  }],
  // 统计列
  statis: {
    label: '合计',
    type: 'sum',
    fields: ['number']
  },
  props: {
    style: {
      width: '100%'
    }
  },
  data
}